package com.blueocean_health.care.management.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import com.blueocean_health.care.management.domain.base.Advert;
import com.blueocean_health.care.management.mapper.AdvertMapper;
import com.blueocean_health.care.management.service.IAppAdvertisementService;
@Service
public class AppAdvertisementServiceImpl implements IAppAdvertisementService {
	@Resource
	private AdvertMapper advertMapper;
	@Value("${service.address}")
	private String serviceAddress;
	@Override
	public List<Advert> appAdvertList() {
		List<Advert> selectAll = advertMapper.selectAll();
		if(selectAll!=null&&selectAll.size()>0){
		for (Advert advert : selectAll) {
			String imgurl = serviceAddress+advert.getImg();
			advert.setImg(imgurl);
			
		}
		}
		return selectAll;
	}

}
